<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path;
%>
<html style="font-size: 66.5333px;">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<title>登录</title>
 <link href="${pageContext.request.contextPath}/css/system/h5_login.css" rel="stylesheet"/>
</head>
<body>
	<div id="panel">
		<div class="panel-top">
			<h2>登录</h2>
		</div>
		<!--面板的主要内容-->
		<div class="panel-content">
			<div class="int">
				<label><img src="http://sps.zhiweit.com/hplus/img/user.png"></label> <input type="text" id="account"
					placeholder="请输入手机号">
			</div>
			<div class="int">
				<label><img src="http://sps.zhiweit.com/hplus/img/locked.png"></label> <input id="pwd"
					type="password" placeholder="请输入密码">
			</div>
			<!--配置信息-->
			<div class="login">
				<button id="login_button">登录</button>
			</div>
		</div>
		<!--面板的底部-->
	</div>
</body>
<script src="<%=basePath%>/hplus/js/jquery.min.js?v=2.1.4"></script>

<script type="text/javascript">
$('#login_button').click(function () {
        var account = $('#account').val();
        var pwd = $('#pwd').val();
        var url = "${pageContext.request.contextPath}/login/ajaxLogin";
        var params = {
            "account": account,
            "pwd": pwd
        };
        $.post(url, params, function (data) {
            if ("200" == data.status || "3" == data.status) {	
            	var cid = data.data;
                //下一步的url	
                window.location.href = "<%=basePath%>/view/ui/h5WriteOff?cid="+cid;			
            } else if ("501" == data.status || "502" == data.status) {
                /* 显示错误 */
                error = data.message
                if (error == "密码错误") {
                	alert("用户名或密码不正确！");	
                    return false;
                } else if (error == "该账号为失效状态，如果有问题请联系管理员"){
                	alert("该账号已停用！");		
                    return false;
                }else if("501" == data.error_code){
                	alert("尚未注册,请先注册");
                }else {
                	alert("登陆失败")
                }
            } 
        }, "json");
});
</script>
</html>
